home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1989 Special Issue / rerun-1989-special-issue.d64 / irq source#6 < prev    next >
Text File  |  2022-09-20  |  2KB  |  57 lines

  1.  
  2. *= $C000
  3. ;
  4. ;       THE SHAKING SCREEN
  5. ; ***** RASTER COMPARE DEMO *****
  6. ;
  7.       SEI                 ;Set Interrupt Disable Flag
  8.       LDA #<NEWIRQ        ;Change IRQ RAM Vector
  9.       STA $0314
  10.       LDA #>NEWIRQ
  11.       STA $0315
  12.       CLI                 ;Clear Interrupt Disable Flag
  13.       LDA #$00            ;Intialize counters and VIC-II chip
  14.       STA $02             ;Set pointer to zero
  15.       STA $D012           ;Set Raster Compare for scan line 0
  16.       LDA #$1B
  17.       STA $D011           ;Set top bit to 0
  18.       LDA #$01
  19.       STA $D01A           ;Enable Raster Compare Interrupt
  20.       STA $DC0D           ;Disable Timer A interrupt from CIA 1
  21.       RTS
  22. NEWIRQ
  23.       LDX $D012           ;Get value of current scan line
  24.       BNE NORMAL          ;If not at scan line 0 normal display
  25. SHIFT
  26.       LDY $02             ;Get pointer to fine scroll data
  27.       INY                 ;Increment pointer
  28.       CPY #$0E            ;If at end of data ...
  29.       BNE GETY
  30.       LDY #$00            ;... then start again
  31. GETY
  32.       LDA YS,Y            ;Get fine scroll data
  33.       STA $D016           ;Put in horizontal fine scroll
  34.                           ;register
  35.       STY $02             ;Save pointer
  36.       LDA #$01
  37.       STA $D019           ;Reset Raster Compare Interrupt Latch
  38.       LDA #$9A            ;Load value of next Raster
  39.                           ;Compare (154)
  40.       STA $D012           ;Save to Raster Compare Register
  41.       JMP $EA81           ;Exit interrupt routine through
  42.                           ;the KERNAL
  43. NORMAL
  44.       LDA #$08            ;Set fine scroll to 0
  45.       STA $D016           ;Save to horizontal fine
  46.                           ;scroll register
  47.       LDA #$01
  48.       STA $D019           ;Reset Raster Compare Interrupt Latch
  49.       LDA #$00            ;Load value of next Raster Compare (0)
  50.       STA $D012           ;Save to Raster Compare Register
  51.       JMP $EA31           ;Jump to KERNAL IRQ routine
  52. YS
  53.       .BYTE 8 9 10 11 12 13 14 15  ;Fine scroll data
  54.       .BYTE 14 13 12 11 10 9
  55.  
  56.  
  57.